<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
request.setCharacterEncoding("UTF-8");
String htmlData = request.getParameter("cont") != null ? request.getParameter("cont") : "";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>凯盛项目管理系统</title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<link rel="stylesheet" href="kind/themes/default/default.css" />
	<link rel="stylesheet" href="kind/plugins/code/prettify.css" />

  </head>
  	<%@ include file="top.jsp" %>
  		<%=htmlData%>
  	<div class="container" >
		<div class="row">
			<div class="span3">
				<div class="well" style="padding: 8px 0;margin-top:70px;" >
					<ul class="nav nav-list">
						<li class="nav-header">${sessionScope.pu.project.name }</li>
						<li>${sessionScope.user.username }:${sessionScope.pu.role }</li>
						<li class="divider"></li>
						<li><a href="project.jspx?id=${sessionScope.pu.projectid }"><i class="icon-home"></i>最新动态</a></li>
						<li><a href="goal.jspx"><i class="icon-flag"></i>目标</a></li>
						<li><a href="document.jspx"><i class="icon-folder-open"></i>资料库</a></li>
						<li ><a href="file.jspx"><i class="icon-file"></i>文件共享</a></li>
						<li><a href="contact.jspx"><i class="icon-user"></i>联系人</a></li>
						<li class="active"><a href="idea.jspx"><i class="icon-fire icon-white"></i>想法</a></li>
						<li><a href="#"><i class="icon-warning-sign"></i>Bug</a></li>
						<li><a href="main.jspx?m=editProject&id=${pu.projectid }"><i class="icon-cog"></i>项目设置</a></li>
					</ul>
				</div>
			</div>
			<div class="span9" style="margin-bottom:0px;border-radius: 3px 3px 0 0">
				<ul class="breadcrumb" style="margin-top:90px;margin-bottom:0px;border-radius:3px 3px 0 0;border-bottom:none;">
					<li class="active">
						<a href="idea.jspx"><i class="icon-fire"></i>想法</a>${requestScope.idea.name}
					</li>
				</ul>
				
				<div class="well" style="border-radius:0;border-top:none">
					<div class="page-header">
						<h3>${requestScope.idea.name}</h3>&nbsp; &nbsp; <small>${requestScope.idea.user.username}发布于 ${requestScope.idea.createtime }</small>
					</div>
					<p>${ requestScope.idea.cont}</p>
					<hr />
					 <h4>评论</h4>
					<hr style="margin:2px;"/>
					<form action="idea.jspx?m=comment&id=${requestScope.idea.id }" method="post" >
						<textarea name="cont"  class="span8" rows="9" ><%=htmlspecialchars(htmlData)%></textarea>
						<br/>
						<button class="btn">发布</button>
				    </form>
				    <c:forEach items="${requestScope.commentlist }"  var="com">
							<blockquote>
							 ${com.cont }
							  <small>
								${com.user.username }发布于 ${com.time}
								<!-- <a href="idea.jspx?m=editcomment&id=${com.id}" title="编辑"><i class="icon-pencil"></i></a>-->
							 	<a href="idea.jspx?m=delcomment&id=${com.id}&ideaid=${requestScope.idea.id}" title="删除"><i class="icon-trash"></i></a>
							  </small>				  
							</blockquote>
					</c:forEach>
					<a href="idea.jspx">←返回想法列表</a>
				</div>
			</div>
		</div>
	</div>
	<script charset="utf-8" src="kind/kindeditor.js"></script>
	<script charset="utf-8" src="kind/lang/zh_CN.js"></script>
	<script charset="utf-8" src=".kind/plugins/code/prettify.js"></script>
	<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="cont"]', {
				cssPath : 'kind/plugins/code/prettify.css',
				uploadJson : 'kind/jsp/upload_json.jsp',
				fileManagerJson : 'kind/jsp/file_manager_json.jsp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['note'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						document.forms['note'].submit();
					});
				}
			});
			prettyPrint();
		});
		
		
		
	
			
	</script>
	
	
  <body>
    
  </body>
</html>
<%!
private String htmlspecialchars(String str) {
	str = str.replaceAll("&", "&amp;");
	str = str.replaceAll("<", "&lt;");
	str = str.replaceAll(">", "&gt;");
	str = str.replaceAll("\"", "&quot;");
	return str;
}
%>
